<!-- 商品分类和轮播图 -->
<form>
    <input type="hidden" name="model_id" value="8" />
<h2 class="attr-title">商品分类和轮播图</h2>
<div class="layui-form-item">
    <label class="layui-form-label sm">背景颜色</label>
    <div class="layui-input-block">
        <div class="color-wrapper">
            <input data-js="color" type="text" name="back_color" value="{$config_info.back_color|default=''}" />
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label sm">上边距</label>
    <div class="layui-input-block">
        <div class="range-wrapper">
            <input type="range" name="padding_top" value="{$config_info.padding_top|default='0'}" onchange="$(this).next().text($(this).val())">
            <span>{$config_info.padding_top|default='0'}</span>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label sm">下边距</label>
    <div class="layui-input-block">
        <div class="range-wrapper">
            <input type="range" name="padding_bottom" value="{$config_info.padding_bottom|default='0'}" onchange="$(this).next().text($(this).val())">
            <span>{$config_info.padding_bottom|default='0'}</span>
        </div>
    </div>
</div>
<div class="model-item">
<div class="layui-form-item">
    <label class="layui-form-label sm">选择分类</label>
    <div class="layui-input-block">
        <div data-js="goods_class"><div data-select></div>
            <input type="hidden" name="goods_class" data-input value="{$config_info.goods_class|default='0'}" />
            <div data-type="template" data-name="gc_id" data-value="{if isset($config_info['gc_id'])}{:json_encode($config_info['gc_id'])}{/if}"></div>
            <table class="dssc-default-table mb15">
                <thead>
                  <tr>
                  <th class="tl">{$Think.lang.ds_goodsclass}</th>
                  <th class="w90">{$Think.lang.ds_sort}</th>
                  </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label sm">分类图标</label>
    <div class="layui-input-block">
        <div class="uploader-wrapper">
            <div class="uploader-image-wrapper" {if !isset($config_info['gc'][0]['image']) || !$config_info['gc'][0]['image']}style="display:none" {/if}>
                                    <img class='uploader-image' src='{$config_info['gc'][0]['image']|default=""}' />
                                    <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                </div>
            <div class='uploader-content' {if isset($config_info['gc'][0]['image']) && $config_info['gc'][0]['image']}style="display:none" {/if}>
                <div class="uploader-icon iconfont">&#xe6bf;</div>
                <div class="uploader-text">点击上传</div>
                <div class="uploader-notice">26×26</div>
                <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
            <input type='hidden' name='gc[i_0][image]' value='{$config_info['gc'][0]['image']|default=""}'>
            </div>
            
        </div>
        <div class="uploader-wrapper">
            <div class="uploader-image-wrapper" {if !isset($config_info['gc'][1]['image']) || !$config_info['gc'][1]['image']}style="display:none" {/if}>
                                    <img class='uploader-image' src='{$config_info['gc'][1]['image']|default=""}' />
                                    <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                </div>
            <div class='uploader-content' {if isset($config_info['gc'][1]['image']) && $config_info['gc'][1]['image']}style="display:none" {/if}>
                <div class="uploader-icon iconfont">&#xe6bf;</div>
                <div class="uploader-text">点击上传</div>
                <div class="uploader-notice">26×26</div>
                <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
            <input type='hidden' name='gc[i_1][image]' value='{$config_info['gc'][1]['image']|default=""}'>
            </div>
            
        </div>
        <div class="uploader-wrapper">
            <div class="uploader-image-wrapper" {if !isset($config_info['gc'][2]['image']) || !$config_info['gc'][2]['image']}style="display:none" {/if}>
                                    <img class='uploader-image' src='{$config_info['gc'][2]['image']|default=""}' />
                                    <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                </div>
            <div class='uploader-content' {if isset($config_info['gc'][2]['image']) && $config_info['gc'][2]['image']}style="display:none" {/if}>
                <div class="uploader-icon iconfont">&#xe6bf;</div>
                <div class="uploader-text">点击上传</div>
                <div class="uploader-notice">26×26</div>
                <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
            <input type='hidden' name='gc[i_2][image]' value='{$config_info['gc'][2]['image']|default=""}'>
            </div>
            
        </div>
        <div class="uploader-wrapper">
            <div class="uploader-image-wrapper" {if !isset($config_info['gc'][3]['image']) || !$config_info['gc'][3]['image']}style="display:none" {/if}>
                                    <img class='uploader-image' src='{$config_info['gc'][3]['image']|default=""}' />
                                    <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                </div>
            <div class='uploader-content' {if isset($config_info['gc'][3]['image']) && $config_info['gc'][3]['image']}style="display:none" {/if}>
                <div class="uploader-icon iconfont">&#xe6bf;</div>
                <div class="uploader-text">点击上传</div>
                <div class="uploader-notice">26×26</div>
                <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
            <input type='hidden' name='gc[i_3][image]' value='{$config_info['gc'][3]['image']|default=""}'>
            </div>
            
        </div>
        <div class="uploader-wrapper">
            <div class="uploader-image-wrapper" {if !isset($config_info['gc'][4]['image']) || !$config_info['gc'][4]['image']}style="display:none" {/if}>
                                    <img class='uploader-image' src='{$config_info['gc'][4]['image']|default=""}' />
                                    <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                </div>
            <div class='uploader-content' {if isset($config_info['gc'][4]['image']) && $config_info['gc'][4]['image']}style="display:none" {/if}>
                <div class="uploader-icon iconfont">&#xe6bf;</div>
                <div class="uploader-text">点击上传</div>
                <div class="uploader-notice">26×26</div>
                <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
            <input type='hidden' name='gc[i_4][image]' value='{$config_info['gc'][4]['image']|default=""}'>
            </div>
            
        </div>
    </div>
</div>
</div>
<div class="model-item">
    <div class="layui-form-item">
        <label class="layui-form-label sm">中间广告</label>
        <div class="layui-input-block">
            <div class="uploader-wrapper">
                <div class="uploader-image-wrapper" {if !isset($config_info['adv_center'][0]['image']) || !$config_info['adv_center'][0]['image']}style="display:none"{/if}>
                                        <img class='uploader-image' src='{$config_info['adv_center'][0]['image']|default=""}' />
                                        <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                    </div>
                <div class='uploader-content' {if isset($config_info['adv_center'][0]['image']) && $config_info['adv_center'][0]['image']}style="display:none"{/if}>
                    <div class="uploader-icon iconfont">&#xe6bf;</div>
                    <div class="uploader-text">点击上传</div>
                    <div class="uploader-notice">800×400</div>
                    <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
                <input type='hidden' name='adv_center[i_0][image]' value="{$config_info['adv_center'][0]['image']|default=""}">
                </div>
                
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name="adv_center[i_0][link]" value="" placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
<div class="model-item">
    <div class="layui-form-item">
        <label class="layui-form-label sm">中间广告</label>
        <div class="layui-input-block">
            <div class="uploader-wrapper">
                <div class="uploader-image-wrapper" {if !isset($config_info['adv_center'][1]['image']) || !$config_info['adv_center'][1]['image']}style="display:none"{/if}>
                                        <img class='uploader-image' src='{$config_info['adv_center'][1]['image']|default=""}' />
                                        <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                    </div>
                <div class='uploader-content' {if isset($config_info['adv_center'][1]['image']) && $config_info['adv_center'][1]['image']}style="display:none"{/if}>
                    <div class="uploader-icon iconfont">&#xe6bf;</div>
                    <div class="uploader-text">点击上传</div>
                    <div class="uploader-notice">800×400</div>
                    <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
                <input type='hidden' name='adv_center[i_1][image]' value="{$config_info['adv_center'][1]['image']|default=""}">
                </div>
                
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name="adv_center[i_1][link]" value="" placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
<div class="model-item">
    <div class="layui-form-item">
        <label class="layui-form-label sm">中间广告</label>
        <div class="layui-input-block">
            <div class="uploader-wrapper">
                <div class="uploader-image-wrapper" {if !isset($config_info['adv_center'][2]['image']) || !$config_info['adv_center'][2]['image']}style="display:none"{/if}>
                                        <img class='uploader-image' src='{$config_info['adv_center'][2]['image']|default=""}' />
                                        <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                    </div>
                <div class='uploader-content' {if isset($config_info['adv_center'][2]['image']) && $config_info['adv_center'][2]['image']}style="display:none"{/if}>
                    <div class="uploader-icon iconfont">&#xe6bf;</div>
                    <div class="uploader-text">点击上传</div>
                    <div class="uploader-notice">800×400</div>
                    <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
                <input type='hidden' name='adv_center[i_2][image]' value="{$config_info['adv_center'][2]['image']|default=""}">
                </div>
                
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name="adv_center[i_2][link]" value="" placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
<div class="model-item">
<div class="layui-form-item">
    <label class="layui-form-label sm">文章标题1</label>
    <div class="layui-input-block">
        <input type="text" name="article_title_1" value="{$config_info.article_title_1|default=''}" placeholder="请输入文章标题1" class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label sm">文章标题2</label>
    <div class="layui-input-block">
        <input type="text" name="article_title_2" value="{$config_info.article_title_2|default=''}" placeholder="请输入文章标题2" class="layui-input">
    </div>
</div>
</div>
<div class="model-item">
    <div class="layui-form-item">
        <label class="layui-form-label sm">文章标题</label>
        <div class="layui-input-block">
            <input type="text" name="article[i_0][title]" value="" placeholder="请输入文章标题" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name="article[i_0][link]" value="" placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
<div class="model-item">
    <div class="layui-form-item">
        <label class="layui-form-label sm">文章标题</label>
        <div class="layui-input-block">
            <input type="text" name="article[i_1][title]" value="" placeholder="请输入文章标题" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name="article[i_1][link]" value="" placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
<div class="model-item">
    <div class="layui-form-item">
        <label class="layui-form-label sm">文章标题</label>
        <div class="layui-input-block">
            <input type="text" name="article[i_2][title]" value="" placeholder="请输入文章标题" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name="article[i_2][link]" value="" placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
<div class="model-item">
    <div class="layui-form-item">
        <label class="layui-form-label sm">右侧广告</label>
        <div class="layui-input-block">
            <div class="uploader-wrapper">
                <div class="uploader-image-wrapper" {if !isset($config_info['adv_right'][0]['image']) || !$config_info['adv_right'][0]['image']}style="display:none"{/if}>
                                        <img class='uploader-image' src='{$config_info['adv_right'][0]['image']|default=""}' />
                                        <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                    </div>
                <div class='uploader-content' {if isset($config_info['adv_right'][0]['image']) && $config_info['adv_right'][0]['image']}style="display:none"{/if}>
                    <div class="uploader-icon iconfont">&#xe6bf;</div>
                    <div class="uploader-text">点击上传</div>
                    <div class="uploader-notice">188×245</div>
                    <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
                <input type='hidden' name='adv_right[i_0][image]' value="{$config_info['adv_right'][0]['image']|default=""}">
                </div>
                
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name="adv_right[i_0][link]" value="" placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
</form>
<script>
    if(typeof(loadConfig8)=='undefined'){
        function loadConfig8(obj){
            obj.find('[data-js="color"]').colorpicker({showOn: 'both'});

            var id=obj.attr('data-id')
            obj.find('[data-js="goods_class"]').attr('id','goods_class_'+id)
            
            var gc_id=parseInt(obj.find('*[data-input]').val())
            if(gc_id){
                getGoodsClass(gc_id,'goods_class_'+id)
            }else{
                loadGoodsClass(1,0,'goods_class_'+id)
            }
        }
    }
</script>